Shunting-yard algorithm